package Package.Test;

import Package.Hashset.Hashset;

import java.util.HashSet;

public class Test1 {
    public static final void Test1(){
        HashSet<Student> hs=new HashSet<Student>();
        //创建学生对象
        Student s1 = new Student("林青霞", 30);
        Student s2 = new Student("张曼玉", 35);
        Student s3 = new Student("王祖贤", 33);
        Student s4 = new Student("王祖贤", 33);
//把学生添加到集合
        hs.add(s1);
        hs.add(s2);
        hs.add(s3);
        hs.add(s4);
        for (Student s:hs
             ) {
            System.out.println(s.getName() + "," + s.getAge());

        }
    }
}
